#include <typedefs.h>
#include <hardwareInit.h>

/// <summary>
/// Initialize Hardware
/// </summary>
void hardwareInit_init(void)
{
	// Enable IO Clocks
	LPC_SYSCON->SYSAHBCLKCTRL |= SYSCLOCK_IOINIT;

	// ensure is reset and pullup is enabled
	LPC_IOCON->RESET_PIO0_13 &= ~0x00000007;
	LPC_IOCON->RESET_PIO0_13 |= (1 << 4);
	LPC_IOCON->RESET_PIO0_13 |= (3 << 11);

	// Set state and direction
	LPC_GPIO0->OUT = PORT_ZERO_STATE;
	LPC_GPIO0->DIR = PORT_ZERO_DIRECTION;

}
